﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.Mvc;
using System.Web.Mvc.Ajax;
using Paradox.Models;
using Paradox.Models.DataModels;
using Paradox.Reporting;
namespace Paradox.Controllers
{
    public class FeedController : Controller
    {
        StoryRepository repo = new StoryRepository();


        RSSDataContext _entities = new RSSDataContext();
        //
        // GET: /Feed/
       
        public ActionResult Index()
        {
           
            
            return RedirectToAction("Recent");
        }

        public ActionResult Recent(int? quantity)
        {


            var stories = repo.GetRecentStories(quantity ?? 10);

            return View("Feed", stories);

        }

        public ActionResult All()
        {
            var stories = repo.GetAllPublishedStories();
            return View("Feed", stories);
        
        }



        
        [Authorize]
        public ActionResult Everything()
        {
            var stories = repo.GetAllStories();
            return View("Feed", stories);
        }
    }
}
